/*
  Copyright (C) 2011 Zhao Ming(zhao.ming29@gmail.com)

  All rights reserved.

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License version 2.1, as
  published by the Free Software Foundation.  This program is
  distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or
  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
  License for more details.

  You should have received a copy of the GNU Lesser General Public License
  along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __RECVBUF_H
#define __RECVBUF_H

class CRecvBuf {
	private:
		static int MaxBufLen;
		char *buf;
		int overLap;
		int writePos;
		int xcorrPos;
		int preRead;
		int demodLen;
	public:
		CRecvBuf( int ol, int demodOL );
		~CRecvBuf();
		int put( char *t, int k );
		int get( char **t, int k );
		int rolOut( int *t, int offset, int rI, int rQ, int Mask[], int len );
		int maskSum( int offset, int& I, int& Q, int Mask[], int len );
};	
#endif
